%% calculateVector
%
% Calculates the vector from point one to point two
%
%% Synatax
%
% [ calculatedVector ] = calculateVector(pointOneCoordinates, ...
%                                        pointTwoCoordinates)
%
% [[5, 5]] = calculateVector([2, 1], [7, 6])
%
% [[5, 5, 1]] = calculateVector([2, 1, 2], [7, 6, 3])
%
%% Description
%
%* Calculates the vector from point one to point two. The points must have
%  the same number of dimensions.
%
%% Arguments
%
%* pointOneCoordinates                  - Double: The X and Y coordinates of
%                                                 the first user selected point
%
%* pointTwoCoordinates                  - Double: The X and Y coordinates of
%                                                 the second user selected point
%
%% Returns
%
%* calculatedVector                     - Double: The vector from point one
%                                                 to point two
%
%% Function Side Effects
%
%* N/A
%
%% Exceptions
%
%* N/A
%
%% See Also
% 

function [ calculatedVector ] = calculateVector( pointOneCoordinates, pointTwoCoordinates )

assert(isempty(pointOneCoordinates) == 0, 'calculateVector:emptyPointOneCoordinates', ...
       'pointOneCoordinates argument cannot be empty');

assert(isempty(pointTwoCoordinates) == 0, 'calculateVector:emptyPointTwoCoordinates', ...
       'pointTwoCoordinates argument cannot be empty');

assert(isa(pointOneCoordinates, 'double'), ...
       'calculateVector:incorrectPointOneCoordinatesType', ...
       'pointOneCoordinates must be type double');
   
assert(isa(pointTwoCoordinates, 'double'), ...
       'calculateVector:incorrectPointTwoCoordinatesType', ...
       'pointTwoCoordinates must be type double');
   
assert(isequal(size(pointOneCoordinates), size(pointTwoCoordinates)), ...
       'calculateVector:dimensionsOfPointsUnequal', ...
       'Point 1 and Point 2 must have the same number of dimensions');


calculatedVector = pointTwoCoordinates - pointOneCoordinates;


end

